package com.xyb.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class LoginUserVo {
    public interface account {
    }

    public interface vCode {
    }


    private String account;

    @Pattern(regexp = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$", message = "手机号格式错误", groups = {LoginUserVo.account.class})
    private String iphoneNo;

    @Email(regexp = "^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$", message = "邮箱格式错误", groups = {LoginUserVo.account.class})
    private String email;
    @NotBlank(message = "密码不能为空",groups = {LoginUserVo.account.class})
    private String pwd;
    @NotBlank(message = "验证码不能为空",groups = {LoginUserVo.vCode.class})
    private int verifyCode;
}
